input_file = "/Users/xuyihang/Desktop/spring.log"  # 输入文件名
output_file = "/Users/xuyihang/Desktop/aaa.txt"  # 输出文件名

# 打开输入文件和输出文件
with open(input_file, "r") as f_input, open(output_file, "w") as f_output:
    # 逐行读取输入文件
    for line in f_input:
        # 检查是否包含问号字符
        if "FaceOnReceiveService-----onReceive----end---cost:"  in line:
            # 将不包含问号的行写入输出文件，并添加换行符
            f_output.write(line.strip() + "\n")
